<?php
//set style
$aJS = array(assets('js/jquery.form.min.js', true), "https://www.google.com/recaptcha/api.js?hl=vi");
$this->frontend_lib->setAJs($aJS);
$info = getOption(array('address', 'phone', 'contact_mail', 'fb_fan_page', 'google_plus', 'google_map_key', 'google_recaptcha_public_key'));
$aMap = array('key'=> $info->google_map_key->opt_val,'q'=>$info->address->opt_val);
?>
<div id="footer">
	<div id="contact-page" class="container">
		<div class="bg">
			<div class="row">
				<div class="col-sm-12">
					<h2 class="title text-center mgt10">Liên hệ với <strong>chúng tôi</strong></h2>
					<div id="gmap" class="contact-map">
						<iframe width="100%" height="385" frameborder="0"	scrolling="no" marginheight="0" marginwidth="0"	src="https://www.google.com/maps/embed/v1/place?<?php echo http_build_query($aMap,'', '&'); ?>"></iframe>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-8">
					<div class="contact-form">
						<h2 class="title text-center">Thông tin của bạn</h2>
						<div id="flg_message" class="alert fade in hidden">
		                    <button type="button" class="close">×</button>
		                    <h4 class="message-title"></h4>
		                    <div class="message-text"></div>
		                </div>
						<form id="main-contact-form" class="contact-form row" name="contact-form" method="post" action="<?php echo page_url(CONTACT_SLUG.'/gui'); ?>">
							<div class="form-group col-md-6">
								<input type="text" class="form-control" required="required" placeholder="Họ tên" name="contact[name]" id="name" maxlength="100"/>
							</div>
							<div class="form-group col-md-6">
								<input type="email" class="form-control" required="required" placeholder="Email" name="contact[email]" id="email" maxlength="250"/>
							</div>
							<div class="form-group col-md-12">
								<input type="text" class="form-control" required="required" placeholder="Tiêu đề" name="contact[subject]" id="subject" maxlength="160" />
							</div>
							<div class="form-group col-md-12">
								<textarea class="form-control" id="message" required="required" rows="8" placeholder="Nội dung yêu cầu" name="contact[message]" id="message" maxlength='10000'></textarea>
							</div>
							<div class="form-group col-md-12" id="captchadiv" data-key="<?php echo getOption('google_recaptcha_public_key') ;?>">
                                <div id="recaptcha" class="g-recaptcha pull-left" data-callback="enable_contact_submit_button" data-btnsubmit=".btn-send-contact" data-sitekey="<?php echo $info->google_recaptcha_public_key->opt_val ?>"></div>
                                <button type="button" disabled="disabled" class="pull-right btn btn-primary btn-send-contact"><i class="glyphicon glyphicon-envelope"></i> Gửi</button>
				            </div>
						</form>
					</div>
				</div>
				<div class="col-sm-4">
					<div class="contact-info">
						<h2 class="title">PHIÊN CHỢ VIỆT</h2>
						<address>
							<p><?php echo $info->address->opt_val; ?></p>
							<p>Mobile: <?php echo $info->phone->opt_val; ?></p>
							<p>Email: <?php echo $info->contact_mail->opt_val; ?></p>
						</address>
						<div class="social-networks">
							<ul>
								<li>
									<a href="<?php echo $info->fb_fan_page->opt_val; ?>"><i class="fa fa-facebook"></i></a>
								</li>
								<li>
									<a href="#"><i class="fa fa-twitter"></i></a>
								</li>
								<li>
									<a href="<?php echo $info->google_plus->opt_val; ?>"><i class="fa fa-google-plus"></i></a>
								</li>
								<li>
									<a href="#"><i class="fa fa-youtube"></i></a>
								</li>
							</ul>
						</div>
					</div>
				</div>
			</div>
		</div>
    </div><!--/#contact-page-->